/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jigdo.downloader;

/**
 * Represents the events necessary for a DownloadEntry task to report its progress.
 * @author John R Sohn
 */
public interface DownloadListener {
    
    /**
     * Fires when the download progresses.
     * @param entry The event sender.
     * @param bytesDownloaded Number of bytes downloaded.
     */
    public void Progress(DownloadEntry entry,  long bytesDownloaded);
   
    /**
     * Fires when the download entry's state changes.
     * @param entry The event sender
     * @param changedState The state change.
     */
    public void StateChanged(DownloadEntry entry, DownloadStatus changedState);
   
    
    /**
     * Fires when an error occurs during this download.
     * @param entry The event sender
     * @param error  The error that occurred.
     */
    public void Error(DownloadEntry entry, Throwable error);
    
}
